{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "522167c06f503b54",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## type->class->object"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "initial_id",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-07-16T13:09:35.182358Z",
     "start_time": "2024-07-16T13:09:35.171560Z"
    },
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "int"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = 10\n",
    "type(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "fc3b99fd99240af0",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-07-16T13:27:53.823345Z",
     "start_time": "2024-07-16T13:27:53.815939Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "type"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(int)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6974061734569d3b",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## object是最顶层基类"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "2839d91d0f353e67",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-07-16T13:13:03.887311Z",
     "start_time": "2024-07-16T13:13:03.880937Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(object,)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "int.__bases__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "f20ec259d698f343",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-07-16T13:13:54.236704Z",
     "start_time": "2024-07-16T13:13:54.211295Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(object,)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type.__bases__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "9f48ff514fe31997",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-07-16T13:23:12.740674Z",
     "start_time": "2024-07-16T13:23:12.720367Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "()"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "object.__bases__\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "80d72c7f0fc8724d",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "## type是一个类，同时也是一个对象"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "834e0a612148c31e",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-07-16T13:23:15.196338Z",
     "start_time": "2024-07-16T13:23:15.184995Z"
    },
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "type"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(object)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "adb82cee88bcf222",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2024-07-16T13:28:21.090831Z",
     "start_time": "2024-07-16T13:28:21.085607Z"
    },
    "collapsed": false
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "grammer-study-12-env",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
